20 lines of code you're working on right now [closed]

Posted by Anton Gogolev on Stack Overflow See other posts from Stack Overflow or by Anton Gogolev
Published on 2010-05-20T17:02:46Z Indexed on 2010/05/20 17:10 UTC
Read the original article Hit count: 161

Out of sheer curiosity. Hope none of you NDAs are violated or whatever.

Here are mine. I'm currently refactoring a massively coupled webapp. As it usually is, no comments and no documentation whatsoever.

if (paymentMethod == PaymentMethod.InAgency )
{
    EmailController.SendBookingCreateEmails(booking);
    this.DC.SubmitChanges();

    return RedirectToAction("Result", new { id = booking.Id });
}
else if (paymentMethod == PaymentMethod.CreditCard)
{
    return RedirectToAction("Pay", new { id = booking.Id });
}
else if(paymentMethod == PaymentMethod.MostravelBank || paymentMethod == PaymentMethod.MostravelCallback ||
    paymentMethod == PaymentMethod.MostravelCardCredit || paymentMethod == PaymentMethod.MostravelCourierCash ||
    paymentMethod == PaymentMethod.MostravelCourierPlasticCard)
{
    isExclusive = true;
    Log.TraceInformation("Started booking for Mostravel. Payment method: {0}", paymentMethod);

    try
    {
        Log.TraceInformation("Sending emails");
        EmailController.SendBookingCreateEmailsEx(booking);

        Log.TraceInformation("Sent emails. Started booking");
        MakeRealBooking(booking, DC.MailRuAgencies.First(a => a.Id == MvcApplication.DefaultMailRuAgencyId));

        Log.TraceInformation("Finished booking");
    }
    catch(Exception ex)
    {
        Log.TraceEvent(TraceEventType.Error, 0, "Error while booking: {0}", ex.ToString());
    }

What are you working on right now?

© Stack Overflow or respective owner

Related posts about offtopic

Related posts about fun